var a = getApp();
Component({
  properties: {
    now: { type: String, value: 'index' },
    cartNum: { type: Number, value: 0 },
  },
  data: {
    isIpx: a.globalData.isIpx,
    selected: null,
    show_tabbar: !0,
    show_back_top: !1,
    color: '#333',
    selectedColor: '#d01716',
    out_set_color: '',
    list: [
      {
        pagePath: '/pages/index/index',
        iconPath: '/images/icon_index.png',
        selectedIconPath: '/images/icon_index_act.png',
        icon_class: 'iconzhuye',
        icon_class_act: 'iconzhuye-xuanzhong',
        jumpType: 'switchTab',
        tagNum: 0,
        text: '首页',
      },
      {
        pagePath: '/pages/category/category',
        iconPath: '/images/icon_classify.png',
        selectedIconPath: '/images/icon_classify_act.png',
        icon_class: 'iconfenlei',
        icon_class_act: 'iconfenlei-xuanzhong',
        jumpType: 'switchTab',
        tagNum: 0,
        text: '分类',
      },
      {
        pagePath: '/pages/cart/cart',
        iconPath: '/images/icon_cart.png',
        selectedIconPath: '/images/icon_cart_act.png',
        icon_class: 'icongouwuche',
        icon_class_act: 'icongouwuche-xuanzhong',
        jumpType: 'switchTab',
        tagNum: wx.getStorageSync('__cartNum'),
        text: '购物车',
      },
      {
        pagePath: '/pages/center/center',
        iconPath: '/images/icon_my.png',
        selectedIconPath: '/images/icon_my_act.png',
        icon_class: 'iconwode',
        icon_class_act: 'iconwode-xuanze',
        jumpType: 'switchTab',
        tagNum: 0,
        text: '我的',
      },
    ],
  },
  ready: function () {},
  methods: {
    switchTab: function (a) {
      var c = a.currentTarget.dataset,
        e = c.path,
        t = c.jump_type;
      wx[t]({ url: e });
    },
    backToTop: function () {
      wx.pageScrollTo && wx.pageScrollTo({ scrollTop: 0 });
    },
  },
});
